/**
 * Copyright 2009 University of Washington This code is released under the GPL version 3 - with a copy of the license
 * included
 * 
 * @author Maya Hao Li
 */
package seedpod.rdb;

import java.sql.ResultSet;
import java.sql.SQLException;

import seedpod.exceptions.SeedpodException;
import seedpod.kb2db.SlotMap;
import seedpod.model.NullSlotMapException;

public interface PersistenceDO {
	public static final Integer UNKNOWN_OID = 0;

	public boolean create() throws SeedpodException;

	public boolean delete() throws SeedpodException;

	public Object getAVPair( SlotMap attribute );

	public Integer getOid();

	public String getState();

	public boolean isDeleted();

	public boolean isDirty();

	public boolean isPersistent();

	public void load( ResultSet rs ) throws SQLException, SeedpodException;

	public void makePersist() throws SeedpodException;

	public void markDirty();

	public boolean retrieve( String queryFilter ) throws SeedpodException;

	public void setAttributeValue( SlotMap attribute, Object value ) throws NullSlotMapException;

	public boolean update() throws SeedpodException;

}
